Release 10.1A: OpenEdge Development:
Progress 4GL Reference
DELETE OBJECT statement
Deletes an instance of an object such as a widget, a procedure, a server, a socket, or a class. Deleting the object instance causes all allocated resources associated with the object instance to be returned to the system (except when otherwise noted).
Syntax
handleA handle to the object to delete. The handle argument must be a variable of type HANDLE and must contain a valid handle.
If the handle parameter refers to a widget handle, the DELETE OBJECT statement is a synonym for the DELETE WIDGET statement.
If the handle parameter refers to a persistent procedure handle or proxy persistent procedure handle, the DELETE OBJECT statement is a synonym for the DELETE PROCEDURE statement. This statement deletes a local persistent procedure handle immediately. For a proxy persistent procedure handle, this statement deletes
Note: This same behavior occurs if the remote procedure deletes itself (using DELETE...THIS-PROCEDURE) on the AppServer.
the handle immediately unless there is an outstanding asynchronous request on this
handle (handle:ASYNC-REQUEST-COUNT is greater than zero (0)). Ifhandle:ASYNC-REQUEST-COUNT is greater than zero (0), this statement raises the ERROR condition. Otherwise, the statement also sends a request to the AppServer to delete the corresponding remote persistent procedure on the AppServer. If the AppServer is executing any asynchronous requests ahead of it, Progress queues the delete request (as with any asynchronous remote request) until the AppServer is available to handle it.For more information on remote persistent procedures, see OpenEdge Application Server: Developing AppServer Applications .
If the handle parameter refers to a server handle, the DELETE OBJECT statement:
- Checks that the handle parameter refers to a valid server handle, and that the handle parameter’s CONNECTED attribute is FALSE (no AppServer is connected to it). If one of these checks fails, the statement raises the ERROR condition.
- Deletes the handle immediately, if the server handle is valid, unless there is an outstanding asynchronous request on this handle (
handle:ASYNC-REQUEST-COUNT is greater than zero (0)). If there is an outstanding asynchronous request, this statement raises the ERROR condition.Deleting a server handle removes the handle from the server handle chain of the SESSION system handle, and resets SESSION:FIRST-SERVER and SESSION:LAST-SERVER if necessary. This also deletes all of the asynchronous request handles associated with the server and then deletes the server object.
If
handlerefers to an asynchronous request handle, the DELETE OBJECT statement takes one of the following actions:- If the
handle:COMPLETE attribute is FALSE, raises the ERROR condition.- If the
handle:COMPLETE attribute is TRUE, removeshandlefrom the chain of asynchronous request handles referenced by the FIRST-ASYNC-REQUEST and the LAST-ASYNC-REQUEST attributes of the server handle, and deleteshandle.If this is a socket handle, the application must disconnect the socket from a port using the DISCONNECT( ) method before a socket object can be deleted. The DELETE OBJECT statement will raise ERROR if an application deletes a socket object that is still associated with a port.
If this is a server socket handle, the application must call DISABLE-CONNECTIONS( ) before a server socket object can be deleted. The DELETE OBJECT statement will raise ERROR if an application deletes a server socket object that is still listening for connections.
object-referenceAn object reference for the class object instance to delete. The object reference argument must be an object reference variable, such as one defined using the DEFINE VARIABLE statement with the CLASS option, and must contain a valid object reference.
Note: You can validate an object reference by using the VALID-OBJECT function.When you delete a class object instance, Progress invokes the destructor method for the class and the destructor method for each class in its inherited class hierarchy, if any. The destructor method is responsible for freeing resources allocated by the object instance when the object is deleted. At this time, the object instance context goes out of scope and all allocated resources are returned to the system. In addition, the object instance is removed from the list of valid object instances referenced by the FIRST-OBJECT and LAST-OBJECT attributes of the SESSION system handle.
If you do not delete a class object instance, the instance remains in memory until the session ends, and Progress does not invoke any destructor methods for the class.
NO-ERRORSuppresses reporting of errors that occur while DELETE OBJECT executes. Afterwards, you can get information on possible errors by checking the ERROR-STATUS system handle.
Notes
- For more information on working with asynchronous remote procedures and event procedures, see OpenEdge Application Server: Developing AppServer Applications .
- For more information on working with socket and server socket objects, see OpenEdge Development: Programming Interfaces .
See also
DELETE PROCEDURE statement, DELETE WIDGET statement, DESTRUCTOR statement, ERROR-STATUS system handle
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |